package com.wj.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

//@RestController
@Controller
@RequestMapping("/test")
public class TestController {
    @GetMapping("/show")
    public @ResponseBody String ss(){
        return "访问到了";
    }

    @RequestMapping("/index")
    public String sss(){
        System.out.println(123);
        return "/index.html";
    }

    @GetMapping("/show-2")
//    @PreAuthorize("hasAuthority('admin')")
    @PreAuthorize("hasRole('admin')")
    public String show2(){
        return "show-2";
    }
}
